import axios from 'axios'

function axiosGet(url,config){
	const baseUrl = '/api' + url
	return new Promise(function(resolve,reject){
		axios.get(baseUrl,config)
		.then(function(res){
			resolve(res.data.message)
		})
		.catch(function(err){
			reject(err)
		})
	})
}

function axiosPost(url,config){
	const baseUrl = '/api' + url
	return new Promise(function(resolve,reject){
		axios.post(baseUrl,config)
		.then(function(res){
			resolve(res.data.message)
		})
		.catch(function(err){
			reject(err)
		})
	})
}

export {
	axiosGet,
	axiosPost
}